import {createRouter, createWebHistory} from 'vue-router'

export const routesChildren = [
    {
        path: '/bar',
        name: '柱状图',
        component: () => import('@/views/bar/index.vue'),
    },
    {
        path: '/line',
        name: '折线图',
        component: () => import('@/views/line/index.vue'),
    },
    {
        path: '/pie',
        name: '饼图',
        component: () => import('@/views/pie/index.vue'),
    },
    {
        path: '/map',
        name: '地图',
        component: () => import('@/views/map/index.vue'),
    },
    {
        path: '/gauge',
        name: '仪表盘',
        component: () => import('@/views/gauge/index.vue'),
    },
    {
        path: '/water',
        name: '水球图',
        component: () => import('@/views/water/index.vue'),
    }
]
const router = createRouter({
    history: createWebHistory(import.meta.env.BASE_URL),
    routes: [
        {
            path: '/',
            name: 'home',
            component: () => import('@/views/index.vue'),
            redirect: "/bar",
            children: routesChildren
        },
        {
            path: '/test',
            name: 'test',
            component: () => import('@/views/test/index.vue'),
        }
    ],
})

export default router
